<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>住院管理</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmlist.css" rel="stylesheet">
    <style>
        .white_contenty {
            display: none;
            position: absolute;
            top: 25%;
            left: 35%;
            width: 900px;
            height: 500px;
            padding: 20px;
            border: 1px solid #9CC2CB;
            background-color: white;
            z-index: 1002;
            overflow: auto;
        }

        .x_nby1 {
            height: 300px;
        }

        .white_contenty1 {
            display: none;
            position: absolute;
            top: 25%;
            left: 35%;
            width: 60%;
            height: 400px;
            padding: 20px;
            border: 1px solid #9CC2CB;
            background-color: white;
            z-index: 1002;
            overflow: auto;
        }

        .chatb {
            margin-left: auto;
            margin-bottom: 10px;
        }

        .chatb1 {
            margin-left: 750px;
            margin-bottom: 10px;
        }

        .niu1 {
            width: 50%;
            height: 350px;

            display: inline-block;
            float: left;

        }

        .niu2 {
            margin-top: -2px;
            width: 50%;
            height: 350px;

            display: inline-block;
            float: left;
        }

        .div1 {
            margin-left: 20px;
            margin-top: 20px;
            width: 300px;
            text-align: center;

        }

        .div2 {
            margin-top: 22px;
            width: 300px;
            text-align: center;

        }

        #idcal {
            width: 300px;
            margin-left: 8px;

        }

        #name {
            width: 250px;
            margin-left: 60px;

        }

        #xb {
            width: 100px;
            margin-left: 100px;

        }

        .white_contentzk {
            display: none;
            position: absolute;
            top: 20%;
            left: 40%;
            width: 40%;
            height: 350px;
            padding: 20px;
            border: 1px solid #9CC2CB;
            background-color: white;
            z-index: 1002;
            overflow: auto;
        }

        #zkz {

            float: left;
        }

        #zky {

            float: left;
            margin-left: 50px;
        }

        #butzk {
            float: left;
            margin-left: 180px;
            margin-top: 50px;
        }

        .login {
            overflow: hidden;
            width: 300px;
        }

        .login .login-item {
            padding: 10px 0;
            overflow: hidden;
            clear: both;
            line-height: 25px;
            padding: 0px;
        }

        .login .login-item label {
            float: left;
            text-align: right;
            width: 80px;
        }

        .login .login-item div {
            float: left;
        }

        .login .login-tools {
            text-align: center;
        }
    </style>
</head>
<body>
<div layout:fragment="content" style="background:#FFF;">
    <div id="lightzk" class="white_contentzk">
        <div class="x_nbzk">
            <div class="x_title">
                <h2>转院 <i class="fa fa-user"></i></h2>
                <div class="chatb">
                    <button onclick="document.getElementById('light').style.display='none';">
                    </button>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <form class="form-horizontal form-label-left" th:action="@{/register/addreport}"
                      action="/register/addreport"
                      method="post">
                    <div id="zkz">
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 科室 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="department" id="department1" class="form-control" style="width:150px"
                                        th:onclick="fudoctor()">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 医生 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="doctor" id="doctor1" class="form-control" style="width:150px">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 床位 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="bed" id="bed1" class="form-control" style="width:150px">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div id="zky">
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 科室 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="department" id="departmentzky" class="form-control" style="width:150px"
                                        th:onclick="fudoctor()">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 医生 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="doctor" id="doctorzky" class="form-control" style="width:150px">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label " style="float: left"> 床位 <span
                                    class="required">*</span></label>
                            <div class="col-md-6 col-sm-6 col-xs-12">
                                <select name="reporttype" id="reporttypezky" class="form-control" style="width:150px">
                                    <option value="0">--请选择--</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div id="butzk" class="form-group">
                        <button id="sendzk" type="submit" class="btn btn-success">提交</button>
                        <button type="button" class="btn btn-primary" id="backzk">返回</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div id="lighty1" class="white_contenty1">
        <div class="x_nby1">
            <div>
                入院登记
                <button class="chatb1" onclick="document.getElementById('lighty1').style.display='none'">
                    ✖
                </button>

                <div class="x_title" style="height: auto">

                </div>
                <table id="datatable-responsivey"
                       class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                       cellspacing="0" width="100%" role="grid"
                       aria-describedby="datatable-responsive_info" style="width: 100%;">
                    <thead>
                    <tr role="row">
                        <th class="sorting_asc" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="First name: activate to sort column descending"
                            aria-sort="ascending">
                            编号
                        </th>
                        <th class="sorting_asc" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="First name: activate to sort column descending"
                            aria-sort="ascending">
                            姓名
                        </th>
                        <th class="sorting_asc" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="First name: activate to sort column descending"
                            aria-sort="ascending">
                            性别
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            年龄
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            单价
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            电话
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            身份证号
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            转院原因
                        </th>
                        <th class="sorting" tabindex="0"
                            aria-controls="datatable-responsive" rowspan="1" colspan="1"
                            aria-label="Last name: activate to sort column ascending">
                            操作
                        </th>
                    </tr>
                    <tbody id="tabl">

                    </tbody>
                    </thead>
                    <tbody id="seldrug">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id="lighty" class="white_contenty">
        <div class="x_nby1">
            <form action="/hospital/addRegister" method="post">

                <div>
                    入院登记
                    <button type="button" class="chatb"
                            onclick="document.getElementById('lighty').style.display='none';">
                        ✖
                    </button>

                    <div class="x_title" style="height: auto">

                    </div>

                    <div class="niu1">
                        <div class="div1" id="name">
                            <label class="layui-form-label">姓名:</label>
                            <input type="hidden" name="reportid" id="reportid" value="">
                            <input type="text" name="userName" id="userName"
                                   readonly placeholder="请输入姓名 ">
                            <button id="start1" type="button" class="layui-btn layui-btn-sm"
                                    onclick="document.getElementById('lighty1').style.display='block';document.getElementById('lighty').style.display='none';start(1);">
                                <i class="layui-icon"></i>
                            </button>
                        </div>
                        <div class="div1" id="xb">
                            <label class="layui-form-label">性别:</label>男
                            <input type="radio" id="nan" name="sex" value="男" title="男" checked>
                            女
                            <input type="radio" id="nv" name="sex" value="女" title="女">
                        </div>
                        <div class="div1">
                            <label class="layui-form-label">年龄:</label>

                            <input type="number" name="age" id="age" readonly placeholder="请输入年龄"
                                   autocomplete="off"
                                   class="layui-input">
                        </div>
                        <div class="div1"><label class="layui-form-label">地址:</label>

                            <input type="text" name="address" placeholder="请输入住址"
                                   class="layui-input">
                        </div>
                        <div class="div1"><label class="layui-form-label">电话:</label>

                            <input type="number" name="Phone" id="phone"
                                   placeholder="请输入电话"
                                   readonly class="layui-input">
                        </div>
                        <div class="div1" id="idcal"><label class="layui-form-label">身份证号:</label>
                            <input type="text" name="Idcard" id="idcard"
                                   placeholder="请输入身份证号"
                                   readonly class="layui-input">
                        </div>
                    </div>
                    <div class="niu2">
                        <div class="div2">
                            <label class="layui-form-label">门诊诊断:</label>
                            <input type="text" name="diagnose" id="diagnose"
                                   placeholder="请输入入院诊断"
                                   readonly class="layui-input">
                        </div>
                        <div class="div2">
                            <label class="layui-form-label">科室:</label>
                            <select name="departmentId" id="departmentId" style="width:150px">
                                <option value="">请选择</option>
                            </select>
                            </td>
                        </div>
                        <div class="div2">
                            <label class="layui-form-label">医生:</label>
                            <select name="doctorId" id="doctorId" style="width:150px">
                                <option value="">请选择</option>
                            </select>
                        </div>

                        <div class="div2">
                            <label class="layui-form-label">床位:</label>
                            <select name="bedId" id="bedId" style="width:150px">
                                <option value="">请选择</option>
                            </select>
                        </div>

                        <div class="div2">
                            <label class="layui-form-label">预交金额:</label>
                            <input type="text" name="money" id="money" lay-verify="required|number"
                                   placeholder="请输入预交金额"
                                   autocomplete="off"
                                   class="layui-input">
                        </div>
                        <div class="div2">
                            <label class="layui-form-label">选择医保:</label>
                            <select name="discount" id="discount" style="width:150px" lay-filter="bedNum">
                                <option value=""></option>
                            </select>
                        </div>
                    </div>

                </div>
                <div class="layui-form-item" id="anniu" style="text-align: center;margin-left: -80px;">
                    <div class="layui-input-block">
                        <button type="submit"
                                class="clayui-btn layui-btn-normal layui-btn-sm layui-icon layui-icon-release"
                                lay-filter="doSubmit" lay-submit="">提交
                        </button>
                        <button type="reset"
                                class="layui-btn layui-btn-warm layui-btn-sm layui-icon layui-icon-refresh">重置
                        </button>
                    </div>
                </div>
            </form>
        </div>

    </div>

    <div class="">
        <div class="clearfix"></div>
        <div class="row" style="border: #BDBDBD solid 2px">>
            <div class="col-md-12">
                <div class="x_title">
                    <h2>
                        入院登记<i class="fa fa-user"></i>
                        <small>
                            - 您可以通过搜索或者其他的筛选项对用户的信息进行编辑、删除等管理操作。^_^
                        </small>
                    </h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form method="post" action="/hospital/list" th:action="@{/hospital/list}">
                        <input type="hidden" name="pageIndex" value="1"/>
                        <ul>
                            <li>
                                <div class="form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">患者姓名</label>
                                    <div class="col-md-6 col-sm-6 col-xs-12">
                                        <input name="userName" type="text" th:value="${userName}"
                                               class="form-control col-md-6 col-xs-12" value="">
                                    </div>
                                </div>
                            </li>
                            <li>
                                <button type="submit" class="btn btn-primary"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询</button>
                            </li>
                        </ul>
                    </form>
                </div>
            </div>

            <div class="col-md-12 lk col-xs-12">
                <div class="x_panel" style="height: 700px">
                    <div class="x_content">
                        <div id="datatable-responsive_wrapper"
                             class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                            <div class="row">
                                <div class="col-sm-12">
                                    <button id="start" type="button" class="btn btn-primary"
                                            onclick="document.getElementById('lighty').style.display='block';">
                                        新增
                                    </button>
                                    <table id="datatable-responsive"
                                           class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                                           cellspacing="0" width="100%" role="grid"
                                           aria-describedby="datatable-responsive_info" style="width: 100%;">
                                        <thead>
                                        <tr role="row">
                                            <th class="sorting_asc" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="First name: activate to sort column descending"
                                                aria-sort="ascending">住院号
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                姓名
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                性别
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                年龄
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                地址
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                电话
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                身份证
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                入院日期
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                科室
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                医生
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                床位
                                            </th>
                                            <th class="sorting" tabindex="0"
                                                aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                                aria-label="Last name: activate to sort column ascending">
                                                操作
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr role="row" class="odd" th:each="list:${user.getRecords()}">
                                            <td tabindex="0" class="sorting_1" th:value="${list.getRegisterid()}"
                                                th:text="${list.getRegisterid()}" th:name="registerid">
                                            </td>
                                            <td th:text="${list.getUserName()}">usrName</td>
                                            <td th:text="${list.getSex()}">sex</td>
                                            <td th:text="${list.getAge()}">age</td>
                                            <td th:text="${list.getAddress()}">address</td>
                                            <td th:text="${list.getPhone()}">phone</td>
                                            <td th:text="${list.getIdcard()}">idcard</td>
                                            <td th:text="${list.getRegisterDate()}">registerDate</td>
                                            <td th:text="${list.getDepartment()}" th:value="${list.getDepartmentId()}">
                                                DepartentId
                                            </td>
                                            <td th:text="${list.getDoctorName()}">doctorName</td>
                                            <td th:text="${list.getBedName()}" th:value="${list.getBedId()}">bedId</td>
                                            <td>
                                                <div id="zhuanke">
                                                    <button type="button" class="layui-btn layui-btn-sm" lay-event="upd"
                                                            onclick="document.getElementById('lightzk').style.display='block';zhuanke(this.registerId)"
                                                            style="background-color: #5bc0de">转科
                                                    </button>
                                                </div>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-5">
                                    <div class="dataTables_info" id="datatable-responsive_info"
                                         role="status" aria-live="polite">共<span
                                            th:text="${user.total }">1</span>条记录
                                        <span th:text="${user.current}">1</span>/<span
                                                th:text="${user.pages}">1</span>页
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers"
                                         id="datatable-responsive_paginate">
                                        <ul class="pagination">

                                            <li class="paginate_button previous" th:if="${user.current gt 0}"><a
                                                    href="javascript:page_nav(document.forms[2],1);"
                                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                                    tabindex="0">首页</a>
                                            </li>

                                            <li class="paginate_button " th:if="${user.current gt 1}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_nav(document.forms[2],'+${user.current}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">上一页</a>
                                            </li>

                                            <li class="paginate_button "
                                                th:if="${(user.current) lt user.pages}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_nav(document.forms[2],'+${user.current+2}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">下一页</a>
                                            </li>

                                            <li class="paginate_button next"
                                                th:if="${(user.current) lt user.pages}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_nav(document.forms[2],'+${user.pages+1}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                                    tabindex="0">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
<script layout:fragment="js">
    var obj;
    $("#start").click(function () {
        $("#discount").empty();
        $.ajax({
            type: "get",
            url: '/hospital/selDepartment',
            dataType: 'json',
            success: function (data) {
                $(data).each(function () {
                    var a = "<option  value=" + this.departmentId + ">" + this.department + "</option>"
                    $("#departmentId").append(a);
                })
            }
        })

        $.ajax({
            type: "post",
            url: '/hospital/selDis',
            dataType: 'json',
            success: function (data) {
                console.info(data)
                $(data).each(function () {
                    var a = " <option  value=" + this.moneytype + ">" + this.moneytype + "</option>"
                    $("#discount").append(a);
                })
            }
        })

    })
    // select下拉框选中触发事件
    $("#departmentId").click(function () {
        var niu = this.value;
        if (niu != "") {
            $("#doctorId").empty();
            $("#doctorId1").empty();
            $("#bedId").empty();
            $("#bedId1").empty();

            $.ajax({
                type: "post",
                url: '/hospital/selDoctor',
                data: {"departmentId": niu},
                dataType: 'json',
                success: function (data) {
                    $(data).each(function () {
                        var a = " <option  value=" + this.doctorId + ">" + this.doctorName + "</option>"
                        $("#doctorId").append(a);
                    })
                }
            })
            $.ajax({
                type: "post",
                url: '/hospital/selBed',
                data: {"departmentId": niu},
                dataType: 'json',
                success: function (data) {
                    console.info(data)
                    $(data).each(function () {
                        var a = " <option  value=" + this.bedId + ">" + this.bedname + "</option>"
                        $("#bedId").append(a);
                    })
                }
            })
        } else {
            $("#doctorId").empty();
            var a = " <option>请选择</option>"
            $("#doctorId").append(a);
            $("#bedId").empty();
            $("#bedId").append(a);

        }
    })

    function start(pageIndex) {
        $.ajax({
            type: "post",
            url: '/hospital/selDoor',
            data: {"pageIndex": pageIndex},
            dataType: 'json',
            success: function (data) {
                $("#x_page1").remove();
                $("#tabl").empty();
                console.info(data.current)
                $(data.records).each(function (index) {
                    obj = JSON.stringify(data.records[index]);
                    var a = "<tr role=\"row\" class=\"odd\" id=\"mobuList1\">" +
                        "<td>" + this.reportId + "</td><td>" + this.reportName + "</td>" +
                        "<td>" + this.sex + "</td><td>" + this.age + "</td>" +
                        "<td>" + this.price + "</td><td>" + this.phone + "</td><td>" + this.carid + "</td><td>" + this.zhuan + "</td><td>" +
                        "                                                <div class=\"btn-group\">\n" +
                        "                                                    <span class=\"btn btn-danger\" onclick='select(" + obj + ")'> 选择 </span>\n" +
                        "                                                </div>\n" +
                        "                                            </td>";
                    +"</td>" + "</tr>";
                    $("#tabl").append(a);
                });
                console.info(data.size)
                var pagepj = "<div id='x_page1' class=\"row\">\n" +
                    "                                        <div class=\"col-sm-5\">\n" +
                    "                                            <div class=\"dataTables_info\" id=\"datatable-responsive_info\"\n" +
                    "                                                 role=\"status\" aria-live=\"polite\">共<span\n" +
                    "                                                    th:text=\"${userPager.totalElements }\">" + data.size + "</span>条记录\n" +
                    "                                                <span th:text=\"${userPager.number+1 }\">" + data.current + "</span>/<span\n" +
                    "                                                        th:text=\"${userPager.totalPages }\">" + data.pages + "</span>页\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                        <div class=\"col-sm-7\">\n" +
                    "                                            <div class=\"dataTables_paginate paging_simple_numbers\"\n" +
                    "                                                 id=\"datatable-responsive_paginate\">\n" +
                    "                                                <ul class=\"pagination\">\n" +
                    "                                                    <li class=\"paginate_button previous\" th:if=\'${" + data.current + " gt 0}\'><a\n" +
                    "                                                            href=\"javascript:page_navg(1);\"\n" +
                    "                                                            aria-controls=\"datatable-responsive\" data-dt-idx=\"0\"\n" +
                    "                                                            tabindex=\"0\">首页</a>\n" +
                    "                                                    </li>\n" +
                    "                                                    <li class=\"paginate_button \" th:if=\'${" + data.current + " gt 0}\'><a\n" +
                    "                                                            href=\"javascript:page_navg(" + (data.current - 1) + ");\"\n" +
                    "                                                            th:onclick=\"'javascript:page_navg(" + (data.current - 1) + ");'\"\n" +
                    "                                                            aria-controls=\"datatable-responsive\" data-dt-idx=\"1\"\n" +
                    "                                                            tabindex=\"0\">上一页</a>\n" +
                    "                                                    </li>\n" +
                    "                                                    <li class=\"paginate_button \"\n" +
                    "                                                        th:if=\'${(" + (data.current + 1) + ") lt " + data.pages + "}\'><a\n" +
                    "                                                            href=\"javascript:page_navg(" + (data.current + 1) + ");\"\n" +
                    "                                                            aria-controls=\"datatable-responsive\" data-dt-idx=\"1\"\n" +
                    "                                                            tabindex=\"0\">下一页</a>\n" +
                    "                                                    </li>\n" +
                    "                                                    <li class=\"paginate_button next\"\n" +
                    "                                                        th:if=\'${(" + (data.current + 1) + ") lt " + data.pages + "}\'><a\n" +
                    "                                                            href=\"javascript:page_navg(" + data.pages + ");\"\n" +
                    "                                                            aria-controls=\"datatable-responsive\" data-dt-idx=\"7\"\n" +
                    "                                                            tabindex=\"0\">最后一页</a>\n" +
                    "                                                    </li>\n" +
                    "                                                </ul>\n" +
                    "                                            </div>\n" +
                    "                                        </div>\n" +
                    "                                    </div>";
                $("#datatable-responsivey").after(pagepj);
            }
        })

    }

    //获取分页里查询的值赋到入院下拉框
    function select(obj) {
        alert(obj.reportName)
        document.getElementById('lighty1').style.display = 'none'
        document.getElementById('lighty').style.display = 'block'
        $("#reportid").val(obj.reportId);
        $("#userName").val(obj.reportName);
        $("#age").val(obj.age);
        $("#diagnose").val(obj.zhuan);
        $("#phone").val(obj.phone);
        $("#idcard").val(obj.carid);
        $("")
        if (obj.sex == "男") {
            $("#nan").attr("checked", "true");
        }
        if (obj.sex == "女") {
            $("#nv").attr("checked", "true");
        }
    }

    //获取分页的值赋到转科页面下拉框
    function zhuanke(registerId) {

        alert(registerId);
        $.ajax({
            type: "post",
            url: '/hospital/registerlist',
            data: {"registerId": registerId},
            dataType: 'json',
            success: function (data) {
                console.info(data)
                $(data).each(function () {
                    var a = "<option  value=" + this.departmentId + ">" + this.department + "</option>";
                    var b = "<option  value=" + this.doctorId + ">" + this.doctorName + "</option>";
                    var c = "<option  value=" + this.bedId + ">" + this.bedName + "</option>";
                    $("#department1").append(a);
                    $("#doctor1").append(b);
                    $("#bed1").append(c);
                })
            }
        })
    }


</script>
</html>